package com.dfbz.netctoss.controller;

import com.dfbz.netctoss.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionController {


    /**
     * controller异常处理
     * @param e
     * @return
     */
    @ExceptionHandler
    @ResponseBody
    public Result doException(Exception e){
        return new Result(false,"操作失败",e.getMessage());
    }
}
